import time
def read(x):
    file = open(x, 'r')
    data = file.readlines()
    return data
def sort(y):
    z = len(y)
    for i in range(z - 1):
        for j in range(z - 1 - i):
            if int(y[j]) < int(y[j + 1]):
                y[j], y[j + 1] = y[j+1], y[j]
m1 = read('m1_sortedfile.txt')
start_t = time.time()
sort(m1)
finish_t = time.time()
print('m1_sortedfile.txt',round((finish_t - start_t) * 1000), 'milliseconds')

m2 = read('m2_reverse.txt')
start_t2 = time.time()
sort(m2)
finish_t2 = time.time()
print('m2_reverse.txt',round((finish_t2 - start_t2) * 1000), 'milliseconds')

m3 = read('m3_shuffle.txt')
start_t3 = time.time()
sort(m3)
finish_t3 = time.time()
print('m3_shuffle.txt',round((finish_t3 - start_t3) * 1000), 'milliseconds')